#!/bin/bash

if [ ! -d logs_pack ]; then
    mkdir logs_pack
fi

date_str=$(date +%Y.%m.%d_%H.%M.%S)

./stop_server.sh

tar -cf temp.tar logs
xz temp.tar
mv temp.tar.xz logs_pack/${date_str}.tar.xz

rm logs/*

./run_server.sh